Pinba is a MySQL storage engine that acts as a realtime monitoring/statistics server for PHP using MySQL as a read-only interface.
It accumulates and processes data sent over UDP by multiple PHP processes and displays statistics in a nice human-readable form of simple "reports", also providing read-only interface to the raw data in order to make possible generation of more sophisticated reports and stats.
With Pinba extension users also can measure particular parts of the code using timers with arbitrary tags.
Pinba is not a debugging tool in a common sense, since you're not supposed to do debugging on production servers, but its main goal is to help developers to monitor performance of PHP scripts, locate bottlenecks in realtime and direct developers' attention to the code that really needs it.
Read on for more details.
Pinba2
Pinba2 is an fork/re-implementation of Pinba developed with performance in mind. We strongly recommend to use it instead of the versions listed below.
Previous (archived) versions
Docker container
Pinba is now available in Docker container via Docker Hub. Run the following command to get it:
docker pull tony2001/pinba
The image contains latest Pinba checkout in Ubuntu:latest environment.
Binary packages
Source code
Latest release: pinba_engine-1.2.0.tar.gz (09 Sep 2016)
Previous release: pinba_engine-1.1.0.tar.gz (12 Feb 2015)
Installation from sources
Interfaces
- Intaro Pinboard - Simple PHP monitoring system, which aggregates and displays Pinba data.
Clients
Even though Pinba was written with PHP in mind, any kind of client can create and send a Pinba packet to the server. Here is the list of clients I know of:
Drop me an email if you know more.
Engine Changelog
1.2.0 - 09 Sep 2016
- Added pinba_log_level configuration directive to configure log verbosity.
- Histograms are now dynamic and can be configured in my.cnf using pinba_histogram_size directive.
- Fixed FreeBSD compatibility.
- Added multiple reader threads with separate data pools to speed up reading and decoding of incoming data.
- Added active_reports table to track reports that produce most CPU load.
- Switched to Google dense/sparse hash instead of Judy where possible.
- Removed libevent dependency.
- Optimized locking and increased overall performance.
1.1.0 - 12 Feb 2015
- Added schema field (mostly to distinguish between HTTPS/HTTP traffic).
- Added memory footprint field to request.
- Added timestamp field to request.
- Added nested messages to allow packet data 'buffering' without reinventing data streaming.
- Added request tags (used to filter requests).>
- Added tagN_reports supporting arbitrary number of timer tags.
- Added 'histograms' - a way to look beyond the 'average' numbers.
- Added support of percentiles in reports.
- Added rusage to timers and timer reports.
- Greatly improved locking and performance.
- All reports now support conditions (min_time/max_time and request tags).
- All CPU-intensive operations with package data are now done using the thread pool (spreading across all available CPU cores).
- Switched to Protobuf-C version to improve performance (this also removes one more library dependency).
- Fixed bug in tag report generation (some data was added, but never deleted from the report).
- Removed pinba_tag_report_timeout (make sure to remove it from my.cnf, or MySQL won't start!).
1.0.0 - 17 Aug 2012
- Added tag_report2 and tag2_report2 mostly replicating their first versions, but with additional grouping by server name and hostname. (Denis Yeldandi)
- Implemented thread pool. ATM the pool is used only when converting Protobuf packets to Pinba internal structs and when deleting outdated data from the request pool. In most cases this means incoming/outdated data is processed MUCH faster and the pools are locked for MUCH less time.
- Fixed reading from timertag table by key.
- Fixed race condition when reading timer tag values.
- Fixed MySQL 5.5/5.6 build.
0.0.6 - 26 Nov 2010
- Added [[Manual:Reports#Conditional_tag_reports|conditional tag reports]].
- Added missing primary key to the timer table.
- Increased default hostname size to 32 chars.
- Changed protobuf proto to use lite runtime (and link against libprotobuf-lite).
- Removed wrong index on tag_id in the timertag table.
- Fixed build with MySQL 5.5 (hopefully, as there is no way to know what they'll break next).
- Fixed potential problem with LDFLAGS in the configure script. (Andrew Sitnikov)
0.0.5 - 19 Oct 2009
- Added rusage to timers (not aggregated on server (yet?)).
- Fixed possible crash caused by long script names.
- Disabled query cache for Pinba engine.
0.0.4 - 26 August 2009
- Added HTTP response code to request data.
- Added support of Google Protocol Buffers 2.1.0+.
- Improved configure checks for MySQL sources and libevent.
- Fixed build on MacOS X.
- Fixed build on FreeBSD.
- Fixed build with static libevent of latest versions.
0.0.3 - 04 May 2009
Preview release
PHP Extension Changelog
1.0.0 - 17 Aug 2012
- Fixed 5_4 build.
- Fixed several minor memleaks.
- Added optional flag to pinba_flush() to flush only stopped timers (use PINBA_FLUSH_ONLY_STOPPED_TIMERS).
0.0.6 - 26 Nov 2010
- Added [[Manual:PHP_extension#pinba_timer_delete()|pinba_timer_delete()]] function.
- Added [[Manual:PHP_extension#pinba_hostname_set()|pinba_hostname_set()]] function.
- Added experimental IPv6 support. (Florian Forster)
- Fixed extension crash on empty tag value.
0.0.5 - 19 Oct 2009
- Added rusage to timers (not aggregated on server (yet?)).
0.0.4 - 26 Aug 2009
- Added HTTP response status to the response data.
- Added support of Google Protocol Buffers 2.1.0+.
- Added [[Manual:PHP_extension#pinba_script_name_set()|pinba_script_name_set()]] function.
0.0.3 - 04 May 2009
Initial release.